{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pandas.tseries.offsets import *\n",
    "from xiao_utils import f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将level_id字段中的-替换为np.nan\n",
    "df = pd.read_csv('../../data/origin/[new] yancheng_train_20171226.csv', dtype={'sale_date':str}, na_values=['-'], low_memory=False)\n",
    "df['sale_date']= pd.to_datetime(df['sale_date'], format='%Y%m')\n",
    "\n",
    "# 将price_level字段转换成有序类别的类型，并用其数值填入该列。\n",
    "df['price_level'] = df['price_level'].astype('category', categories=['5WL','5-8W','8-10W','10-15W','15-20W','20-25W','25-35W','35-50W','50-75W'], ordered=True)\n",
    "df['price_level'] = df['price_level'].cat.codes\n",
    "\n",
    "# 待选方案：先把power和扭矩字段带/的行复制一份，然后将新行里的销量清零，将原行和新行的power和扭矩字段的值分别赋为slash前后的值。\n",
    "# 现行方案：先他娘的直接把slash和后面的值删掉。省得影响记录条数相关的统计量。\n",
    "def process_power_and_torque(s):\n",
    "    return s.split('/')[0]\n",
    "df['power'] = df['power'].astype(str).apply(process_power_and_torque).astype(float) #[18600]\n",
    "df['engine_torque'] = df['engine_torque'].astype(str).apply(process_power_and_torque).astype(float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = df.groupby(['class_id','sale_date']).sum()['sale_quantity']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = a.reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "sale_201611 = pd.DataFrame(a[a['sale_date']==pd.to_datetime('201611', format=\"%Y%m\")])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "sale_201611['sale_201611'] = sale_201611['sale_quantity'] * 1.15"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "class_id         118\n",
       "sale_date        118\n",
       "sale_quantity    118\n",
       "sale_201611      118\n",
       "dtype: int64"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sale_201611.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>class_id</th>\n",
       "      <th>sale_date</th>\n",
       "      <th>sale_quantity</th>\n",
       "      <th>sale_201611</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>876</td>\n",
       "      <td>1007.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>124140</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>301</td>\n",
       "      <td>346.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>132</th>\n",
       "      <td>125403</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>131</td>\n",
       "      <td>150.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>202</th>\n",
       "      <td>136916</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>213</td>\n",
       "      <td>244.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>266</th>\n",
       "      <td>175962</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>411</td>\n",
       "      <td>472.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>336</th>\n",
       "      <td>178529</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>222</td>\n",
       "      <td>255.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>357</th>\n",
       "      <td>186250</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>274</td>\n",
       "      <td>315.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>428</th>\n",
       "      <td>194450</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>319</td>\n",
       "      <td>366.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>481</th>\n",
       "      <td>198427</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>187</td>\n",
       "      <td>215.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>509</th>\n",
       "      <td>206765</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1592</td>\n",
       "      <td>1830.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>579</th>\n",
       "      <td>209945</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>395</td>\n",
       "      <td>454.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>618</th>\n",
       "      <td>219195</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>490</td>\n",
       "      <td>563.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>673</th>\n",
       "      <td>221795</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>228</td>\n",
       "      <td>262.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>692</th>\n",
       "      <td>245609</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>161</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>762</th>\n",
       "      <td>248352</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>872</td>\n",
       "      <td>1002.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>774</th>\n",
       "      <td>249875</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>9</td>\n",
       "      <td>10.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>794</th>\n",
       "      <td>250658</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>122</td>\n",
       "      <td>140.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>863</th>\n",
       "      <td>265980</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>282</td>\n",
       "      <td>324.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>897</th>\n",
       "      <td>270690</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1124</td>\n",
       "      <td>1292.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>967</th>\n",
       "      <td>281301</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>606</td>\n",
       "      <td>696.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1008</th>\n",
       "      <td>281792</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>431</td>\n",
       "      <td>495.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1049</th>\n",
       "      <td>289386</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>373</td>\n",
       "      <td>428.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1067</th>\n",
       "      <td>289403</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>204</td>\n",
       "      <td>234.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1137</th>\n",
       "      <td>290854</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>232</td>\n",
       "      <td>266.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1207</th>\n",
       "      <td>291086</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>724</td>\n",
       "      <td>832.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1267</th>\n",
       "      <td>291514</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>60</td>\n",
       "      <td>69.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1279</th>\n",
       "      <td>302513</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>34</td>\n",
       "      <td>39.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1349</th>\n",
       "      <td>304458</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>432</td>\n",
       "      <td>496.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1401</th>\n",
       "      <td>308913</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>148</td>\n",
       "      <td>170.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1471</th>\n",
       "      <td>321683</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>2262</td>\n",
       "      <td>2601.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4183</th>\n",
       "      <td>713651</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>174</td>\n",
       "      <td>200.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4260</th>\n",
       "      <td>714152</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>645</td>\n",
       "      <td>741.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4298</th>\n",
       "      <td>714860</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>313</td>\n",
       "      <td>359.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4367</th>\n",
       "      <td>732758</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>189</td>\n",
       "      <td>217.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4437</th>\n",
       "      <td>735971</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>3267</td>\n",
       "      <td>3757.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4459</th>\n",
       "      <td>736094</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>459</td>\n",
       "      <td>527.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4499</th>\n",
       "      <td>739296</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1314</td>\n",
       "      <td>1511.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4536</th>\n",
       "      <td>741152</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>808</td>\n",
       "      <td>929.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4550</th>\n",
       "      <td>743957</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>899</td>\n",
       "      <td>1033.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4616</th>\n",
       "      <td>745137</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1278</td>\n",
       "      <td>1469.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4644</th>\n",
       "      <td>750340</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>238</td>\n",
       "      <td>273.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4716</th>\n",
       "      <td>786351</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>657</td>\n",
       "      <td>755.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4751</th>\n",
       "      <td>810398</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>95</td>\n",
       "      <td>109.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4831</th>\n",
       "      <td>819061</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>562</td>\n",
       "      <td>646.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4855</th>\n",
       "      <td>851857</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>275</td>\n",
       "      <td>316.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4907</th>\n",
       "      <td>854079</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>292</td>\n",
       "      <td>335.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4977</th>\n",
       "      <td>871642</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>161</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5051</th>\n",
       "      <td>883691</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>334</td>\n",
       "      <td>384.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5125</th>\n",
       "      <td>905745</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>172</td>\n",
       "      <td>197.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5195</th>\n",
       "      <td>914348</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1024</td>\n",
       "      <td>1177.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5263</th>\n",
       "      <td>923841</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>396</td>\n",
       "      <td>455.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5297</th>\n",
       "      <td>924154</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1274</td>\n",
       "      <td>1465.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5310</th>\n",
       "      <td>948936</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>61</td>\n",
       "      <td>70.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5326</th>\n",
       "      <td>950264</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>779</td>\n",
       "      <td>895.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5347</th>\n",
       "      <td>953842</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1401</td>\n",
       "      <td>1611.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5417</th>\n",
       "      <td>961362</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>114</td>\n",
       "      <td>131.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5487</th>\n",
       "      <td>961962</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>201</td>\n",
       "      <td>231.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5524</th>\n",
       "      <td>963845</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>421</td>\n",
       "      <td>484.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5536</th>\n",
       "      <td>973106</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>10</td>\n",
       "      <td>11.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5575</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>400</td>\n",
       "      <td>460.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>118 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      class_id  sale_date  sale_quantity  sale_201611\n",
       "20      103507 2016-11-01            876      1007.40\n",
       "62      124140 2016-11-01            301       346.15\n",
       "132     125403 2016-11-01            131       150.65\n",
       "202     136916 2016-11-01            213       244.95\n",
       "266     175962 2016-11-01            411       472.65\n",
       "336     178529 2016-11-01            222       255.30\n",
       "357     186250 2016-11-01            274       315.10\n",
       "428     194450 2016-11-01            319       366.85\n",
       "481     198427 2016-11-01            187       215.05\n",
       "509     206765 2016-11-01           1592      1830.80\n",
       "579     209945 2016-11-01            395       454.25\n",
       "618     219195 2016-11-01            490       563.50\n",
       "673     221795 2016-11-01            228       262.20\n",
       "692     245609 2016-11-01            161       185.15\n",
       "762     248352 2016-11-01            872      1002.80\n",
       "774     249875 2016-11-01              9        10.35\n",
       "794     250658 2016-11-01            122       140.30\n",
       "863     265980 2016-11-01            282       324.30\n",
       "897     270690 2016-11-01           1124      1292.60\n",
       "967     281301 2016-11-01            606       696.90\n",
       "1008    281792 2016-11-01            431       495.65\n",
       "1049    289386 2016-11-01            373       428.95\n",
       "1067    289403 2016-11-01            204       234.60\n",
       "1137    290854 2016-11-01            232       266.80\n",
       "1207    291086 2016-11-01            724       832.60\n",
       "1267    291514 2016-11-01             60        69.00\n",
       "1279    302513 2016-11-01             34        39.10\n",
       "1349    304458 2016-11-01            432       496.80\n",
       "1401    308913 2016-11-01            148       170.20\n",
       "1471    321683 2016-11-01           2262      2601.30\n",
       "...        ...        ...            ...          ...\n",
       "4183    713651 2016-11-01            174       200.10\n",
       "4260    714152 2016-11-01            645       741.75\n",
       "4298    714860 2016-11-01            313       359.95\n",
       "4367    732758 2016-11-01            189       217.35\n",
       "4437    735971 2016-11-01           3267      3757.05\n",
       "4459    736094 2016-11-01            459       527.85\n",
       "4499    739296 2016-11-01           1314      1511.10\n",
       "4536    741152 2016-11-01            808       929.20\n",
       "4550    743957 2016-11-01            899      1033.85\n",
       "4616    745137 2016-11-01           1278      1469.70\n",
       "4644    750340 2016-11-01            238       273.70\n",
       "4716    786351 2016-11-01            657       755.55\n",
       "4751    810398 2016-11-01             95       109.25\n",
       "4831    819061 2016-11-01            562       646.30\n",
       "4855    851857 2016-11-01            275       316.25\n",
       "4907    854079 2016-11-01            292       335.80\n",
       "4977    871642 2016-11-01            161       185.15\n",
       "5051    883691 2016-11-01            334       384.10\n",
       "5125    905745 2016-11-01            172       197.80\n",
       "5195    914348 2016-11-01           1024      1177.60\n",
       "5263    923841 2016-11-01            396       455.40\n",
       "5297    924154 2016-11-01           1274      1465.10\n",
       "5310    948936 2016-11-01             61        70.15\n",
       "5326    950264 2016-11-01            779       895.85\n",
       "5347    953842 2016-11-01           1401      1611.15\n",
       "5417    961362 2016-11-01            114       131.10\n",
       "5487    961962 2016-11-01            201       231.15\n",
       "5524    963845 2016-11-01            421       484.15\n",
       "5536    973106 2016-11-01             10        11.50\n",
       "5575    978089 2016-11-01            400       460.00\n",
       "\n",
       "[118 rows x 4 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sale_201611"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "%qtconsole"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "s_1710 = pd.read_csv('../../result/Oct_mul_115percents.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "s1710 = s_1710.drop('predict_date', axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "cf = sale_201611[['class_id','sale_201611']].rename(columns={'sale_201611':'predict_quantity'}).combine_first(other=s1710)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>class_id</th>\n",
       "      <th>predict_quantity</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>103507.0</td>\n",
       "      <td>207.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>124140.0</td>\n",
       "      <td>302.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>125403.0</td>\n",
       "      <td>179.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>136916.0</td>\n",
       "      <td>186.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>169673.0</td>\n",
       "      <td>175.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>175962.0</td>\n",
       "      <td>273.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>178529.0</td>\n",
       "      <td>170.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>186250.0</td>\n",
       "      <td>95.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>194201.0</td>\n",
       "      <td>435.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>194450.0</td>\n",
       "      <td>312.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>198427.0</td>\n",
       "      <td>114.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>206765.0</td>\n",
       "      <td>2366.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>209945.0</td>\n",
       "      <td>105.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>219195.0</td>\n",
       "      <td>144.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>221795.0</td>\n",
       "      <td>450.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>245609.0</td>\n",
       "      <td>139.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>248352.0</td>\n",
       "      <td>299.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>249875.0</td>\n",
       "      <td>159.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>250658.0</td>\n",
       "      <td>215.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>265980.0</td>\n",
       "      <td>235.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>103507.0</td>\n",
       "      <td>1007.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>281301.0</td>\n",
       "      <td>378.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>281792.0</td>\n",
       "      <td>553.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>289386.0</td>\n",
       "      <td>507.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>289403.0</td>\n",
       "      <td>313.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>290854.0</td>\n",
       "      <td>236.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>291086.0</td>\n",
       "      <td>368.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>291514.0</td>\n",
       "      <td>57.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>302513.0</td>\n",
       "      <td>195.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>304458.0</td>\n",
       "      <td>429.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4183</th>\n",
       "      <td>713651.0</td>\n",
       "      <td>200.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4260</th>\n",
       "      <td>714152.0</td>\n",
       "      <td>741.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4298</th>\n",
       "      <td>714860.0</td>\n",
       "      <td>359.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4367</th>\n",
       "      <td>732758.0</td>\n",
       "      <td>217.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4437</th>\n",
       "      <td>735971.0</td>\n",
       "      <td>3757.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4459</th>\n",
       "      <td>736094.0</td>\n",
       "      <td>527.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4499</th>\n",
       "      <td>739296.0</td>\n",
       "      <td>1511.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4536</th>\n",
       "      <td>741152.0</td>\n",
       "      <td>929.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4550</th>\n",
       "      <td>743957.0</td>\n",
       "      <td>1033.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4616</th>\n",
       "      <td>745137.0</td>\n",
       "      <td>1469.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4644</th>\n",
       "      <td>750340.0</td>\n",
       "      <td>273.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4716</th>\n",
       "      <td>786351.0</td>\n",
       "      <td>755.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4751</th>\n",
       "      <td>810398.0</td>\n",
       "      <td>109.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4831</th>\n",
       "      <td>819061.0</td>\n",
       "      <td>646.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4855</th>\n",
       "      <td>851857.0</td>\n",
       "      <td>316.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4907</th>\n",
       "      <td>854079.0</td>\n",
       "      <td>335.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4977</th>\n",
       "      <td>871642.0</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5051</th>\n",
       "      <td>883691.0</td>\n",
       "      <td>384.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5125</th>\n",
       "      <td>905745.0</td>\n",
       "      <td>197.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5195</th>\n",
       "      <td>914348.0</td>\n",
       "      <td>1177.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5263</th>\n",
       "      <td>923841.0</td>\n",
       "      <td>455.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5297</th>\n",
       "      <td>924154.0</td>\n",
       "      <td>1465.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5310</th>\n",
       "      <td>948936.0</td>\n",
       "      <td>70.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5326</th>\n",
       "      <td>950264.0</td>\n",
       "      <td>895.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5347</th>\n",
       "      <td>953842.0</td>\n",
       "      <td>1611.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5417</th>\n",
       "      <td>961362.0</td>\n",
       "      <td>131.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5487</th>\n",
       "      <td>961962.0</td>\n",
       "      <td>231.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5524</th>\n",
       "      <td>963845.0</td>\n",
       "      <td>484.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5536</th>\n",
       "      <td>973106.0</td>\n",
       "      <td>11.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5575</th>\n",
       "      <td>978089.0</td>\n",
       "      <td>460.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>255 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      class_id  predict_quantity\n",
       "0     103507.0            207.00\n",
       "1     124140.0            302.00\n",
       "2     125403.0            179.00\n",
       "3     136916.0            186.00\n",
       "4     169673.0            175.00\n",
       "5     175962.0            273.00\n",
       "6     178529.0            170.00\n",
       "7     186250.0             95.00\n",
       "8     194201.0            435.00\n",
       "9     194450.0            312.00\n",
       "10    198427.0            114.00\n",
       "11    206765.0           2366.00\n",
       "12    209945.0            105.00\n",
       "13    219195.0            144.00\n",
       "14    221795.0            450.00\n",
       "15    245609.0            139.00\n",
       "16    248352.0            299.00\n",
       "17    249875.0            159.00\n",
       "18    250658.0            215.00\n",
       "19    265980.0            235.00\n",
       "20    103507.0           1007.40\n",
       "21    281301.0            378.00\n",
       "22    281792.0            553.00\n",
       "23    289386.0            507.00\n",
       "24    289403.0            313.00\n",
       "25    290854.0            236.00\n",
       "26    291086.0            368.00\n",
       "27    291514.0             57.00\n",
       "28    302513.0            195.00\n",
       "29    304458.0            429.00\n",
       "...        ...               ...\n",
       "4183  713651.0            200.10\n",
       "4260  714152.0            741.75\n",
       "4298  714860.0            359.95\n",
       "4367  732758.0            217.35\n",
       "4437  735971.0           3757.05\n",
       "4459  736094.0            527.85\n",
       "4499  739296.0           1511.10\n",
       "4536  741152.0            929.20\n",
       "4550  743957.0           1033.85\n",
       "4616  745137.0           1469.70\n",
       "4644  750340.0            273.70\n",
       "4716  786351.0            755.55\n",
       "4751  810398.0            109.25\n",
       "4831  819061.0            646.30\n",
       "4855  851857.0            316.25\n",
       "4907  854079.0            335.80\n",
       "4977  871642.0            185.15\n",
       "5051  883691.0            384.10\n",
       "5125  905745.0            197.80\n",
       "5195  914348.0           1177.60\n",
       "5263  923841.0            455.40\n",
       "5297  924154.0           1465.10\n",
       "5310  948936.0             70.15\n",
       "5326  950264.0            895.85\n",
       "5347  953842.0           1611.15\n",
       "5417  961362.0            131.10\n",
       "5487  961962.0            231.15\n",
       "5524  963845.0            484.15\n",
       "5536  973106.0             11.50\n",
       "5575  978089.0            460.00\n",
       "\n",
       "[255 rows x 2 columns]"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>class_id</th>\n",
       "      <th>sale_date</th>\n",
       "      <th>sale_quantity</th>\n",
       "      <th>sale_201611</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>103507</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>876</td>\n",
       "      <td>1007.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>124140</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>301</td>\n",
       "      <td>346.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>132</th>\n",
       "      <td>125403</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>131</td>\n",
       "      <td>150.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>202</th>\n",
       "      <td>136916</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>213</td>\n",
       "      <td>244.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>266</th>\n",
       "      <td>175962</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>411</td>\n",
       "      <td>472.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>336</th>\n",
       "      <td>178529</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>222</td>\n",
       "      <td>255.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>357</th>\n",
       "      <td>186250</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>274</td>\n",
       "      <td>315.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>428</th>\n",
       "      <td>194450</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>319</td>\n",
       "      <td>366.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>481</th>\n",
       "      <td>198427</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>187</td>\n",
       "      <td>215.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>509</th>\n",
       "      <td>206765</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1592</td>\n",
       "      <td>1830.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>579</th>\n",
       "      <td>209945</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>395</td>\n",
       "      <td>454.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>618</th>\n",
       "      <td>219195</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>490</td>\n",
       "      <td>563.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>673</th>\n",
       "      <td>221795</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>228</td>\n",
       "      <td>262.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>692</th>\n",
       "      <td>245609</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>161</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>762</th>\n",
       "      <td>248352</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>872</td>\n",
       "      <td>1002.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>774</th>\n",
       "      <td>249875</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>9</td>\n",
       "      <td>10.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>794</th>\n",
       "      <td>250658</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>122</td>\n",
       "      <td>140.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>863</th>\n",
       "      <td>265980</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>282</td>\n",
       "      <td>324.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>897</th>\n",
       "      <td>270690</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1124</td>\n",
       "      <td>1292.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>967</th>\n",
       "      <td>281301</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>606</td>\n",
       "      <td>696.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1008</th>\n",
       "      <td>281792</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>431</td>\n",
       "      <td>495.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1049</th>\n",
       "      <td>289386</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>373</td>\n",
       "      <td>428.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1067</th>\n",
       "      <td>289403</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>204</td>\n",
       "      <td>234.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1137</th>\n",
       "      <td>290854</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>232</td>\n",
       "      <td>266.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1207</th>\n",
       "      <td>291086</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>724</td>\n",
       "      <td>832.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1267</th>\n",
       "      <td>291514</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>60</td>\n",
       "      <td>69.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1279</th>\n",
       "      <td>302513</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>34</td>\n",
       "      <td>39.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1349</th>\n",
       "      <td>304458</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>432</td>\n",
       "      <td>496.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1401</th>\n",
       "      <td>308913</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>148</td>\n",
       "      <td>170.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1471</th>\n",
       "      <td>321683</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>2262</td>\n",
       "      <td>2601.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4183</th>\n",
       "      <td>713651</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>174</td>\n",
       "      <td>200.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4260</th>\n",
       "      <td>714152</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>645</td>\n",
       "      <td>741.75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4298</th>\n",
       "      <td>714860</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>313</td>\n",
       "      <td>359.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4367</th>\n",
       "      <td>732758</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>189</td>\n",
       "      <td>217.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4437</th>\n",
       "      <td>735971</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>3267</td>\n",
       "      <td>3757.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4459</th>\n",
       "      <td>736094</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>459</td>\n",
       "      <td>527.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4499</th>\n",
       "      <td>739296</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1314</td>\n",
       "      <td>1511.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4536</th>\n",
       "      <td>741152</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>808</td>\n",
       "      <td>929.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4550</th>\n",
       "      <td>743957</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>899</td>\n",
       "      <td>1033.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4616</th>\n",
       "      <td>745137</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1278</td>\n",
       "      <td>1469.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4644</th>\n",
       "      <td>750340</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>238</td>\n",
       "      <td>273.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4716</th>\n",
       "      <td>786351</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>657</td>\n",
       "      <td>755.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4751</th>\n",
       "      <td>810398</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>95</td>\n",
       "      <td>109.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4831</th>\n",
       "      <td>819061</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>562</td>\n",
       "      <td>646.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4855</th>\n",
       "      <td>851857</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>275</td>\n",
       "      <td>316.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4907</th>\n",
       "      <td>854079</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>292</td>\n",
       "      <td>335.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4977</th>\n",
       "      <td>871642</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>161</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5051</th>\n",
       "      <td>883691</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>334</td>\n",
       "      <td>384.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5125</th>\n",
       "      <td>905745</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>172</td>\n",
       "      <td>197.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5195</th>\n",
       "      <td>914348</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1024</td>\n",
       "      <td>1177.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5263</th>\n",
       "      <td>923841</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>396</td>\n",
       "      <td>455.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5297</th>\n",
       "      <td>924154</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1274</td>\n",
       "      <td>1465.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5310</th>\n",
       "      <td>948936</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>61</td>\n",
       "      <td>70.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5326</th>\n",
       "      <td>950264</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>779</td>\n",
       "      <td>895.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5347</th>\n",
       "      <td>953842</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>1401</td>\n",
       "      <td>1611.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5417</th>\n",
       "      <td>961362</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>114</td>\n",
       "      <td>131.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5487</th>\n",
       "      <td>961962</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>201</td>\n",
       "      <td>231.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5524</th>\n",
       "      <td>963845</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>421</td>\n",
       "      <td>484.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5536</th>\n",
       "      <td>973106</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>10</td>\n",
       "      <td>11.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5575</th>\n",
       "      <td>978089</td>\n",
       "      <td>2016-11-01</td>\n",
       "      <td>400</td>\n",
       "      <td>460.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>118 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      class_id  sale_date  sale_quantity  sale_201611\n",
       "20      103507 2016-11-01            876      1007.40\n",
       "62      124140 2016-11-01            301       346.15\n",
       "132     125403 2016-11-01            131       150.65\n",
       "202     136916 2016-11-01            213       244.95\n",
       "266     175962 2016-11-01            411       472.65\n",
       "336     178529 2016-11-01            222       255.30\n",
       "357     186250 2016-11-01            274       315.10\n",
       "428     194450 2016-11-01            319       366.85\n",
       "481     198427 2016-11-01            187       215.05\n",
       "509     206765 2016-11-01           1592      1830.80\n",
       "579     209945 2016-11-01            395       454.25\n",
       "618     219195 2016-11-01            490       563.50\n",
       "673     221795 2016-11-01            228       262.20\n",
       "692     245609 2016-11-01            161       185.15\n",
       "762     248352 2016-11-01            872      1002.80\n",
       "774     249875 2016-11-01              9        10.35\n",
       "794     250658 2016-11-01            122       140.30\n",
       "863     265980 2016-11-01            282       324.30\n",
       "897     270690 2016-11-01           1124      1292.60\n",
       "967     281301 2016-11-01            606       696.90\n",
       "1008    281792 2016-11-01            431       495.65\n",
       "1049    289386 2016-11-01            373       428.95\n",
       "1067    289403 2016-11-01            204       234.60\n",
       "1137    290854 2016-11-01            232       266.80\n",
       "1207    291086 2016-11-01            724       832.60\n",
       "1267    291514 2016-11-01             60        69.00\n",
       "1279    302513 2016-11-01             34        39.10\n",
       "1349    304458 2016-11-01            432       496.80\n",
       "1401    308913 2016-11-01            148       170.20\n",
       "1471    321683 2016-11-01           2262      2601.30\n",
       "...        ...        ...            ...          ...\n",
       "4183    713651 2016-11-01            174       200.10\n",
       "4260    714152 2016-11-01            645       741.75\n",
       "4298    714860 2016-11-01            313       359.95\n",
       "4367    732758 2016-11-01            189       217.35\n",
       "4437    735971 2016-11-01           3267      3757.05\n",
       "4459    736094 2016-11-01            459       527.85\n",
       "4499    739296 2016-11-01           1314      1511.10\n",
       "4536    741152 2016-11-01            808       929.20\n",
       "4550    743957 2016-11-01            899      1033.85\n",
       "4616    745137 2016-11-01           1278      1469.70\n",
       "4644    750340 2016-11-01            238       273.70\n",
       "4716    786351 2016-11-01            657       755.55\n",
       "4751    810398 2016-11-01             95       109.25\n",
       "4831    819061 2016-11-01            562       646.30\n",
       "4855    851857 2016-11-01            275       316.25\n",
       "4907    854079 2016-11-01            292       335.80\n",
       "4977    871642 2016-11-01            161       185.15\n",
       "5051    883691 2016-11-01            334       384.10\n",
       "5125    905745 2016-11-01            172       197.80\n",
       "5195    914348 2016-11-01           1024      1177.60\n",
       "5263    923841 2016-11-01            396       455.40\n",
       "5297    924154 2016-11-01           1274      1465.10\n",
       "5310    948936 2016-11-01             61        70.15\n",
       "5326    950264 2016-11-01            779       895.85\n",
       "5347    953842 2016-11-01           1401      1611.15\n",
       "5417    961362 2016-11-01            114       131.10\n",
       "5487    961962 2016-11-01            201       231.15\n",
       "5524    963845 2016-11-01            421       484.15\n",
       "5536    973106 2016-11-01             10        11.50\n",
       "5575    978089 2016-11-01            400       460.00\n",
       "\n",
       "[118 rows x 4 columns]"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sale_201611"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>class_id</th>\n",
       "      <th>sale_quantity</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>103507</td>\n",
       "      <td>207.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>124140</td>\n",
       "      <td>302.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>125403</td>\n",
       "      <td>179.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>136916</td>\n",
       "      <td>186.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>169673</td>\n",
       "      <td>175.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>175962</td>\n",
       "      <td>273.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>178529</td>\n",
       "      <td>170.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>186250</td>\n",
       "      <td>95.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>194201</td>\n",
       "      <td>435.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>194450</td>\n",
       "      <td>312.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>198427</td>\n",
       "      <td>114.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>206765</td>\n",
       "      <td>2366.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>209945</td>\n",
       "      <td>105.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>219195</td>\n",
       "      <td>144.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>221795</td>\n",
       "      <td>450.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>245609</td>\n",
       "      <td>139.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>248352</td>\n",
       "      <td>299.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>249875</td>\n",
       "      <td>159.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>250658</td>\n",
       "      <td>215.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>265980</td>\n",
       "      <td>235.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>270690</td>\n",
       "      <td>684.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>281301</td>\n",
       "      <td>378.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>281792</td>\n",
       "      <td>553.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>289386</td>\n",
       "      <td>507.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>289403</td>\n",
       "      <td>313.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>290854</td>\n",
       "      <td>236.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>291086</td>\n",
       "      <td>368.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>291514</td>\n",
       "      <td>57.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>302513</td>\n",
       "      <td>195.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>304458</td>\n",
       "      <td>429.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>745137</td>\n",
       "      <td>980.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>750340</td>\n",
       "      <td>109.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>760412</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>786351</td>\n",
       "      <td>120.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>114</th>\n",
       "      <td>789290</td>\n",
       "      <td>89.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>810398</td>\n",
       "      <td>131.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>116</th>\n",
       "      <td>815230</td>\n",
       "      <td>193.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>819061</td>\n",
       "      <td>108.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>118</th>\n",
       "      <td>842246</td>\n",
       "      <td>139.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>851857</td>\n",
       "      <td>181.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>854079</td>\n",
       "      <td>186.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>854548</td>\n",
       "      <td>140.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>861459</td>\n",
       "      <td>290.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123</th>\n",
       "      <td>871642</td>\n",
       "      <td>178.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>872180</td>\n",
       "      <td>146.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125</th>\n",
       "      <td>883691</td>\n",
       "      <td>292.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>890189</td>\n",
       "      <td>1497.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>127</th>\n",
       "      <td>905061</td>\n",
       "      <td>417.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>128</th>\n",
       "      <td>905745</td>\n",
       "      <td>210.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>914348</td>\n",
       "      <td>555.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>130</th>\n",
       "      <td>923841</td>\n",
       "      <td>738.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>131</th>\n",
       "      <td>924154</td>\n",
       "      <td>1371.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>132</th>\n",
       "      <td>948936</td>\n",
       "      <td>86.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>133</th>\n",
       "      <td>950264</td>\n",
       "      <td>1416.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>953842</td>\n",
       "      <td>1220.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>135</th>\n",
       "      <td>961362</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>961962</td>\n",
       "      <td>92.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>963845</td>\n",
       "      <td>238.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>138</th>\n",
       "      <td>973106</td>\n",
       "      <td>124.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>139</th>\n",
       "      <td>978089</td>\n",
       "      <td>460.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>140 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     class_id  sale_quantity\n",
       "0      103507          207.0\n",
       "1      124140          302.0\n",
       "2      125403          179.0\n",
       "3      136916          186.0\n",
       "4      169673          175.0\n",
       "5      175962          273.0\n",
       "6      178529          170.0\n",
       "7      186250           95.0\n",
       "8      194201          435.0\n",
       "9      194450          312.0\n",
       "10     198427          114.0\n",
       "11     206765         2366.0\n",
       "12     209945          105.0\n",
       "13     219195          144.0\n",
       "14     221795          450.0\n",
       "15     245609          139.0\n",
       "16     248352          299.0\n",
       "17     249875          159.0\n",
       "18     250658          215.0\n",
       "19     265980          235.0\n",
       "20     270690          684.0\n",
       "21     281301          378.0\n",
       "22     281792          553.0\n",
       "23     289386          507.0\n",
       "24     289403          313.0\n",
       "25     290854          236.0\n",
       "26     291086          368.0\n",
       "27     291514           57.0\n",
       "28     302513          195.0\n",
       "29     304458          429.0\n",
       "..        ...            ...\n",
       "110    745137          980.0\n",
       "111    750340          109.0\n",
       "112    760412           76.0\n",
       "113    786351          120.0\n",
       "114    789290           89.0\n",
       "115    810398          131.0\n",
       "116    815230          193.0\n",
       "117    819061          108.0\n",
       "118    842246          139.0\n",
       "119    851857          181.0\n",
       "120    854079          186.0\n",
       "121    854548          140.0\n",
       "122    861459          290.0\n",
       "123    871642          178.0\n",
       "124    872180          146.0\n",
       "125    883691          292.0\n",
       "126    890189         1497.0\n",
       "127    905061          417.0\n",
       "128    905745          210.0\n",
       "129    914348          555.0\n",
       "130    923841          738.0\n",
       "131    924154         1371.0\n",
       "132    948936           86.0\n",
       "133    950264         1416.0\n",
       "134    953842         1220.0\n",
       "135    961362           84.0\n",
       "136    961962           92.0\n",
       "137    963845          238.0\n",
       "138    973106          124.0\n",
       "139    978089          460.0\n",
       "\n",
       "[140 rows x 2 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1710"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "s1611 = sale_201611[['class_id','sale_201611']].rename(columns={'sale_201611':'predict_quantity'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "res = pd.read_csv('../../data/origin/yancheng_testA_20171225.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [],
   "source": [
    "merged = pd.merge(s1710,s1611, on='class_id', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>class_id</th>\n",
       "      <th>predict_quantity_x</th>\n",
       "      <th>predict_quantity_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>103507</td>\n",
       "      <td>207.0</td>\n",
       "      <td>1007.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>124140</td>\n",
       "      <td>302.0</td>\n",
       "      <td>346.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>125403</td>\n",
       "      <td>179.0</td>\n",
       "      <td>150.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>136916</td>\n",
       "      <td>186.0</td>\n",
       "      <td>244.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>169673</td>\n",
       "      <td>175.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>175962</td>\n",
       "      <td>273.0</td>\n",
       "      <td>472.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>178529</td>\n",
       "      <td>170.0</td>\n",
       "      <td>255.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>186250</td>\n",
       "      <td>95.0</td>\n",
       "      <td>315.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>194201</td>\n",
       "      <td>435.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>194450</td>\n",
       "      <td>312.0</td>\n",
       "      <td>366.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>198427</td>\n",
       "      <td>114.0</td>\n",
       "      <td>215.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>206765</td>\n",
       "      <td>2366.0</td>\n",
       "      <td>1830.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>209945</td>\n",
       "      <td>105.0</td>\n",
       "      <td>454.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>219195</td>\n",
       "      <td>144.0</td>\n",
       "      <td>563.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>221795</td>\n",
       "      <td>450.0</td>\n",
       "      <td>262.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>245609</td>\n",
       "      <td>139.0</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>248352</td>\n",
       "      <td>299.0</td>\n",
       "      <td>1002.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>249875</td>\n",
       "      <td>159.0</td>\n",
       "      <td>10.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>250658</td>\n",
       "      <td>215.0</td>\n",
       "      <td>140.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>265980</td>\n",
       "      <td>235.0</td>\n",
       "      <td>324.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>270690</td>\n",
       "      <td>684.0</td>\n",
       "      <td>1292.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>281301</td>\n",
       "      <td>378.0</td>\n",
       "      <td>696.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>281792</td>\n",
       "      <td>553.0</td>\n",
       "      <td>495.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>289386</td>\n",
       "      <td>507.0</td>\n",
       "      <td>428.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>289403</td>\n",
       "      <td>313.0</td>\n",
       "      <td>234.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>290854</td>\n",
       "      <td>236.0</td>\n",
       "      <td>266.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>291086</td>\n",
       "      <td>368.0</td>\n",
       "      <td>832.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>291514</td>\n",
       "      <td>57.0</td>\n",
       "      <td>69.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>302513</td>\n",
       "      <td>195.0</td>\n",
       "      <td>39.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>304458</td>\n",
       "      <td>429.0</td>\n",
       "      <td>496.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>745137</td>\n",
       "      <td>980.0</td>\n",
       "      <td>1469.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>750340</td>\n",
       "      <td>109.0</td>\n",
       "      <td>273.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>760412</td>\n",
       "      <td>76.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>786351</td>\n",
       "      <td>120.0</td>\n",
       "      <td>755.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>114</th>\n",
       "      <td>789290</td>\n",
       "      <td>89.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>810398</td>\n",
       "      <td>131.0</td>\n",
       "      <td>109.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>116</th>\n",
       "      <td>815230</td>\n",
       "      <td>193.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>819061</td>\n",
       "      <td>108.0</td>\n",
       "      <td>646.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>118</th>\n",
       "      <td>842246</td>\n",
       "      <td>139.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>851857</td>\n",
       "      <td>181.0</td>\n",
       "      <td>316.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>854079</td>\n",
       "      <td>186.0</td>\n",
       "      <td>335.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>854548</td>\n",
       "      <td>140.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>861459</td>\n",
       "      <td>290.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123</th>\n",
       "      <td>871642</td>\n",
       "      <td>178.0</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>872180</td>\n",
       "      <td>146.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125</th>\n",
       "      <td>883691</td>\n",
       "      <td>292.0</td>\n",
       "      <td>384.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>890189</td>\n",
       "      <td>1497.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>127</th>\n",
       "      <td>905061</td>\n",
       "      <td>417.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>128</th>\n",
       "      <td>905745</td>\n",
       "      <td>210.0</td>\n",
       "      <td>197.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>914348</td>\n",
       "      <td>555.0</td>\n",
       "      <td>1177.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>130</th>\n",
       "      <td>923841</td>\n",
       "      <td>738.0</td>\n",
       "      <td>455.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>131</th>\n",
       "      <td>924154</td>\n",
       "      <td>1371.0</td>\n",
       "      <td>1465.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>132</th>\n",
       "      <td>948936</td>\n",
       "      <td>86.0</td>\n",
       "      <td>70.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>133</th>\n",
       "      <td>950264</td>\n",
       "      <td>1416.0</td>\n",
       "      <td>895.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>953842</td>\n",
       "      <td>1220.0</td>\n",
       "      <td>1611.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>135</th>\n",
       "      <td>961362</td>\n",
       "      <td>84.0</td>\n",
       "      <td>131.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>961962</td>\n",
       "      <td>92.0</td>\n",
       "      <td>231.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>963845</td>\n",
       "      <td>238.0</td>\n",
       "      <td>484.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>138</th>\n",
       "      <td>973106</td>\n",
       "      <td>124.0</td>\n",
       "      <td>11.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>139</th>\n",
       "      <td>978089</td>\n",
       "      <td>460.0</td>\n",
       "      <td>460.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>140 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     class_id  predict_quantity_x  predict_quantity_y\n",
       "0      103507               207.0             1007.40\n",
       "1      124140               302.0              346.15\n",
       "2      125403               179.0              150.65\n",
       "3      136916               186.0              244.95\n",
       "4      169673               175.0                 NaN\n",
       "5      175962               273.0              472.65\n",
       "6      178529               170.0              255.30\n",
       "7      186250                95.0              315.10\n",
       "8      194201               435.0                 NaN\n",
       "9      194450               312.0              366.85\n",
       "10     198427               114.0              215.05\n",
       "11     206765              2366.0             1830.80\n",
       "12     209945               105.0              454.25\n",
       "13     219195               144.0              563.50\n",
       "14     221795               450.0              262.20\n",
       "15     245609               139.0              185.15\n",
       "16     248352               299.0             1002.80\n",
       "17     249875               159.0               10.35\n",
       "18     250658               215.0              140.30\n",
       "19     265980               235.0              324.30\n",
       "20     270690               684.0             1292.60\n",
       "21     281301               378.0              696.90\n",
       "22     281792               553.0              495.65\n",
       "23     289386               507.0              428.95\n",
       "24     289403               313.0              234.60\n",
       "25     290854               236.0              266.80\n",
       "26     291086               368.0              832.60\n",
       "27     291514                57.0               69.00\n",
       "28     302513               195.0               39.10\n",
       "29     304458               429.0              496.80\n",
       "..        ...                 ...                 ...\n",
       "110    745137               980.0             1469.70\n",
       "111    750340               109.0              273.70\n",
       "112    760412                76.0                 NaN\n",
       "113    786351               120.0              755.55\n",
       "114    789290                89.0                 NaN\n",
       "115    810398               131.0              109.25\n",
       "116    815230               193.0                 NaN\n",
       "117    819061               108.0              646.30\n",
       "118    842246               139.0                 NaN\n",
       "119    851857               181.0              316.25\n",
       "120    854079               186.0              335.80\n",
       "121    854548               140.0                 NaN\n",
       "122    861459               290.0                 NaN\n",
       "123    871642               178.0              185.15\n",
       "124    872180               146.0                 NaN\n",
       "125    883691               292.0              384.10\n",
       "126    890189              1497.0                 NaN\n",
       "127    905061               417.0                 NaN\n",
       "128    905745               210.0              197.80\n",
       "129    914348               555.0             1177.60\n",
       "130    923841               738.0              455.40\n",
       "131    924154              1371.0             1465.10\n",
       "132    948936                86.0               70.15\n",
       "133    950264              1416.0              895.85\n",
       "134    953842              1220.0             1611.15\n",
       "135    961362                84.0              131.10\n",
       "136    961962                92.0              231.15\n",
       "137    963845               238.0              484.15\n",
       "138    973106               124.0               11.50\n",
       "139    978089               460.0              460.00\n",
       "\n",
       "[140 rows x 3 columns]"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "merged"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\xiao\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    }
   ],
   "source": [
    "merged[merged['predict_quantity_y'].isnull()]['predict_quantity_y'] = merged[merged['predict_quantity_y'].isnull()]['predict_quantity_x']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "merged.loc[merged['predict_quantity_y'].isnull(), 'predict_quantity_y'] = merged[merged['predict_quantity_y'].isnull()]['predict_quantity_x']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>class_id</th>\n",
       "      <th>predict_quantity_x</th>\n",
       "      <th>predict_quantity_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>103507</td>\n",
       "      <td>207.0</td>\n",
       "      <td>1007.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>124140</td>\n",
       "      <td>302.0</td>\n",
       "      <td>346.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>125403</td>\n",
       "      <td>179.0</td>\n",
       "      <td>150.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>136916</td>\n",
       "      <td>186.0</td>\n",
       "      <td>244.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>169673</td>\n",
       "      <td>175.0</td>\n",
       "      <td>175.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>175962</td>\n",
       "      <td>273.0</td>\n",
       "      <td>472.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>178529</td>\n",
       "      <td>170.0</td>\n",
       "      <td>255.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>186250</td>\n",
       "      <td>95.0</td>\n",
       "      <td>315.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>194201</td>\n",
       "      <td>435.0</td>\n",
       "      <td>435.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>194450</td>\n",
       "      <td>312.0</td>\n",
       "      <td>366.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>198427</td>\n",
       "      <td>114.0</td>\n",
       "      <td>215.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>206765</td>\n",
       "      <td>2366.0</td>\n",
       "      <td>1830.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>209945</td>\n",
       "      <td>105.0</td>\n",
       "      <td>454.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>219195</td>\n",
       "      <td>144.0</td>\n",
       "      <td>563.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>221795</td>\n",
       "      <td>450.0</td>\n",
       "      <td>262.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>245609</td>\n",
       "      <td>139.0</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>248352</td>\n",
       "      <td>299.0</td>\n",
       "      <td>1002.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>249875</td>\n",
       "      <td>159.0</td>\n",
       "      <td>10.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>250658</td>\n",
       "      <td>215.0</td>\n",
       "      <td>140.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>265980</td>\n",
       "      <td>235.0</td>\n",
       "      <td>324.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>270690</td>\n",
       "      <td>684.0</td>\n",
       "      <td>1292.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>281301</td>\n",
       "      <td>378.0</td>\n",
       "      <td>696.90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>281792</td>\n",
       "      <td>553.0</td>\n",
       "      <td>495.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>289386</td>\n",
       "      <td>507.0</td>\n",
       "      <td>428.95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>289403</td>\n",
       "      <td>313.0</td>\n",
       "      <td>234.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>290854</td>\n",
       "      <td>236.0</td>\n",
       "      <td>266.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>291086</td>\n",
       "      <td>368.0</td>\n",
       "      <td>832.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>291514</td>\n",
       "      <td>57.0</td>\n",
       "      <td>69.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>302513</td>\n",
       "      <td>195.0</td>\n",
       "      <td>39.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>304458</td>\n",
       "      <td>429.0</td>\n",
       "      <td>496.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>745137</td>\n",
       "      <td>980.0</td>\n",
       "      <td>1469.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>750340</td>\n",
       "      <td>109.0</td>\n",
       "      <td>273.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>760412</td>\n",
       "      <td>76.0</td>\n",
       "      <td>76.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>786351</td>\n",
       "      <td>120.0</td>\n",
       "      <td>755.55</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>114</th>\n",
       "      <td>789290</td>\n",
       "      <td>89.0</td>\n",
       "      <td>89.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>810398</td>\n",
       "      <td>131.0</td>\n",
       "      <td>109.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>116</th>\n",
       "      <td>815230</td>\n",
       "      <td>193.0</td>\n",
       "      <td>193.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>819061</td>\n",
       "      <td>108.0</td>\n",
       "      <td>646.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>118</th>\n",
       "      <td>842246</td>\n",
       "      <td>139.0</td>\n",
       "      <td>139.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>851857</td>\n",
       "      <td>181.0</td>\n",
       "      <td>316.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>854079</td>\n",
       "      <td>186.0</td>\n",
       "      <td>335.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>854548</td>\n",
       "      <td>140.0</td>\n",
       "      <td>140.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>861459</td>\n",
       "      <td>290.0</td>\n",
       "      <td>290.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123</th>\n",
       "      <td>871642</td>\n",
       "      <td>178.0</td>\n",
       "      <td>185.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>872180</td>\n",
       "      <td>146.0</td>\n",
       "      <td>146.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125</th>\n",
       "      <td>883691</td>\n",
       "      <td>292.0</td>\n",
       "      <td>384.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>890189</td>\n",
       "      <td>1497.0</td>\n",
       "      <td>1497.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>127</th>\n",
       "      <td>905061</td>\n",
       "      <td>417.0</td>\n",
       "      <td>417.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>128</th>\n",
       "      <td>905745</td>\n",
       "      <td>210.0</td>\n",
       "      <td>197.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>914348</td>\n",
       "      <td>555.0</td>\n",
       "      <td>1177.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>130</th>\n",
       "      <td>923841</td>\n",
       "      <td>738.0</td>\n",
       "      <td>455.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>131</th>\n",
       "      <td>924154</td>\n",
       "      <td>1371.0</td>\n",
       "      <td>1465.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>132</th>\n",
       "      <td>948936</td>\n",
       "      <td>86.0</td>\n",
       "      <td>70.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>133</th>\n",
       "      <td>950264</td>\n",
       "      <td>1416.0</td>\n",
       "      <td>895.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>953842</td>\n",
       "      <td>1220.0</td>\n",
       "      <td>1611.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>135</th>\n",
       "      <td>961362</td>\n",
       "      <td>84.0</td>\n",
       "      <td>131.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>961962</td>\n",
       "      <td>92.0</td>\n",
       "      <td>231.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>963845</td>\n",
       "      <td>238.0</td>\n",
       "      <td>484.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>138</th>\n",
       "      <td>973106</td>\n",
       "      <td>124.0</td>\n",
       "      <td>11.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>139</th>\n",
       "      <td>978089</td>\n",
       "      <td>460.0</td>\n",
       "      <td>460.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>140 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     class_id  predict_quantity_x  predict_quantity_y\n",
       "0      103507               207.0             1007.40\n",
       "1      124140               302.0              346.15\n",
       "2      125403               179.0              150.65\n",
       "3      136916               186.0              244.95\n",
       "4      169673               175.0              175.00\n",
       "5      175962               273.0              472.65\n",
       "6      178529               170.0              255.30\n",
       "7      186250                95.0              315.10\n",
       "8      194201               435.0              435.00\n",
       "9      194450               312.0              366.85\n",
       "10     198427               114.0              215.05\n",
       "11     206765              2366.0             1830.80\n",
       "12     209945               105.0              454.25\n",
       "13     219195               144.0              563.50\n",
       "14     221795               450.0              262.20\n",
       "15     245609               139.0              185.15\n",
       "16     248352               299.0             1002.80\n",
       "17     249875               159.0               10.35\n",
       "18     250658               215.0              140.30\n",
       "19     265980               235.0              324.30\n",
       "20     270690               684.0             1292.60\n",
       "21     281301               378.0              696.90\n",
       "22     281792               553.0              495.65\n",
       "23     289386               507.0              428.95\n",
       "24     289403               313.0              234.60\n",
       "25     290854               236.0              266.80\n",
       "26     291086               368.0              832.60\n",
       "27     291514                57.0               69.00\n",
       "28     302513               195.0               39.10\n",
       "29     304458               429.0              496.80\n",
       "..        ...                 ...                 ...\n",
       "110    745137               980.0             1469.70\n",
       "111    750340               109.0              273.70\n",
       "112    760412                76.0               76.00\n",
       "113    786351               120.0              755.55\n",
       "114    789290                89.0               89.00\n",
       "115    810398               131.0              109.25\n",
       "116    815230               193.0              193.00\n",
       "117    819061               108.0              646.30\n",
       "118    842246               139.0              139.00\n",
       "119    851857               181.0              316.25\n",
       "120    854079               186.0              335.80\n",
       "121    854548               140.0              140.00\n",
       "122    861459               290.0              290.00\n",
       "123    871642               178.0              185.15\n",
       "124    872180               146.0              146.00\n",
       "125    883691               292.0              384.10\n",
       "126    890189              1497.0             1497.00\n",
       "127    905061               417.0              417.00\n",
       "128    905745               210.0              197.80\n",
       "129    914348               555.0             1177.60\n",
       "130    923841               738.0              455.40\n",
       "131    924154              1371.0             1465.10\n",
       "132    948936                86.0               70.15\n",
       "133    950264              1416.0              895.85\n",
       "134    953842              1220.0             1611.15\n",
       "135    961362                84.0              131.10\n",
       "136    961962                92.0              231.15\n",
       "137    963845               238.0              484.15\n",
       "138    973106               124.0               11.50\n",
       "139    978089               460.0              460.00\n",
       "\n",
       "[140 rows x 3 columns]"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "merged"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 求16年11月和17年10月销量（二者都乘以了1.15）的均值\n",
    "merged['predict_quantity'] = merged[['predict_quantity_x', 'predict_quantity_y']].mean(1).round(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 用16年11月销量乘以1.15，空缺的值用17年10月乘以1.15的值来填充，以此作为预测17年11月的\n",
    "merged['predict_quantity'] = merged['predict_quantity_y']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "res_1611_popwith_1710 = pd.merge(res.drop('predict_quantity', axis=1), merged[['class_id','predict_quantity']], on='class_id', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [],
   "source": [
    "res_1611_popwith_1710.to_csv(\"../../result/16Nov_mul_115(fillwith_17Oct_mul_115).csv\",index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [],
   "source": [
    "res_1611_1710 = pd.merge(res.drop('predict_quantity', axis=1), merged[['class_id','predict_quantity']], on='class_id', how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>predict_date</th>\n",
       "      <th>class_id</th>\n",
       "      <th>predict_quantity</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>201711</td>\n",
       "      <td>103507</td>\n",
       "      <td>607.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>201711</td>\n",
       "      <td>124140</td>\n",
       "      <td>324.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>201711</td>\n",
       "      <td>125403</td>\n",
       "      <td>165.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>201711</td>\n",
       "      <td>136916</td>\n",
       "      <td>215.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>201711</td>\n",
       "      <td>169673</td>\n",
       "      <td>175.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>201711</td>\n",
       "      <td>175962</td>\n",
       "      <td>373.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>201711</td>\n",
       "      <td>178529</td>\n",
       "      <td>213.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>201711</td>\n",
       "      <td>186250</td>\n",
       "      <td>205.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>201711</td>\n",
       "      <td>194201</td>\n",
       "      <td>435.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>201711</td>\n",
       "      <td>194450</td>\n",
       "      <td>339.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>201711</td>\n",
       "      <td>198427</td>\n",
       "      <td>165.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>201711</td>\n",
       "      <td>206765</td>\n",
       "      <td>2098.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>201711</td>\n",
       "      <td>209945</td>\n",
       "      <td>280.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>201711</td>\n",
       "      <td>219195</td>\n",
       "      <td>354.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>201711</td>\n",
       "      <td>221795</td>\n",
       "      <td>356.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>201711</td>\n",
       "      <td>245609</td>\n",
       "      <td>162.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>201711</td>\n",
       "      <td>248352</td>\n",
       "      <td>651.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>201711</td>\n",
       "      <td>249875</td>\n",
       "      <td>85.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>201711</td>\n",
       "      <td>250658</td>\n",
       "      <td>178.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>201711</td>\n",
       "      <td>265980</td>\n",
       "      <td>280.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>201711</td>\n",
       "      <td>270690</td>\n",
       "      <td>988.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>201711</td>\n",
       "      <td>281301</td>\n",
       "      <td>537.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>201711</td>\n",
       "      <td>281792</td>\n",
       "      <td>524.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>201711</td>\n",
       "      <td>289386</td>\n",
       "      <td>468.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>201711</td>\n",
       "      <td>289403</td>\n",
       "      <td>274.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>201711</td>\n",
       "      <td>290854</td>\n",
       "      <td>251.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>201711</td>\n",
       "      <td>291086</td>\n",
       "      <td>600.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>201711</td>\n",
       "      <td>291514</td>\n",
       "      <td>63.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>201711</td>\n",
       "      <td>302513</td>\n",
       "      <td>117.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>201711</td>\n",
       "      <td>304458</td>\n",
       "      <td>463.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>110</th>\n",
       "      <td>201711</td>\n",
       "      <td>745137</td>\n",
       "      <td>1225.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>111</th>\n",
       "      <td>201711</td>\n",
       "      <td>750340</td>\n",
       "      <td>191.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>112</th>\n",
       "      <td>201711</td>\n",
       "      <td>760412</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>201711</td>\n",
       "      <td>786351</td>\n",
       "      <td>438.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>114</th>\n",
       "      <td>201711</td>\n",
       "      <td>789290</td>\n",
       "      <td>89.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>201711</td>\n",
       "      <td>810398</td>\n",
       "      <td>120.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>116</th>\n",
       "      <td>201711</td>\n",
       "      <td>815230</td>\n",
       "      <td>193.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>117</th>\n",
       "      <td>201711</td>\n",
       "      <td>819061</td>\n",
       "      <td>377.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>118</th>\n",
       "      <td>201711</td>\n",
       "      <td>842246</td>\n",
       "      <td>139.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>201711</td>\n",
       "      <td>851857</td>\n",
       "      <td>249.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>201711</td>\n",
       "      <td>854079</td>\n",
       "      <td>261.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>201711</td>\n",
       "      <td>854548</td>\n",
       "      <td>140.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>201711</td>\n",
       "      <td>861459</td>\n",
       "      <td>290.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>123</th>\n",
       "      <td>201711</td>\n",
       "      <td>871642</td>\n",
       "      <td>182.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>124</th>\n",
       "      <td>201711</td>\n",
       "      <td>872180</td>\n",
       "      <td>146.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>125</th>\n",
       "      <td>201711</td>\n",
       "      <td>883691</td>\n",
       "      <td>338.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>201711</td>\n",
       "      <td>890189</td>\n",
       "      <td>1497.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>127</th>\n",
       "      <td>201711</td>\n",
       "      <td>905061</td>\n",
       "      <td>417.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>128</th>\n",
       "      <td>201711</td>\n",
       "      <td>905745</td>\n",
       "      <td>204.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>201711</td>\n",
       "      <td>914348</td>\n",
       "      <td>866.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>130</th>\n",
       "      <td>201711</td>\n",
       "      <td>923841</td>\n",
       "      <td>597.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>131</th>\n",
       "      <td>201711</td>\n",
       "      <td>924154</td>\n",
       "      <td>1418.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>132</th>\n",
       "      <td>201711</td>\n",
       "      <td>948936</td>\n",
       "      <td>78.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>133</th>\n",
       "      <td>201711</td>\n",
       "      <td>950264</td>\n",
       "      <td>1156.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>134</th>\n",
       "      <td>201711</td>\n",
       "      <td>953842</td>\n",
       "      <td>1416.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>135</th>\n",
       "      <td>201711</td>\n",
       "      <td>961362</td>\n",
       "      <td>108.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136</th>\n",
       "      <td>201711</td>\n",
       "      <td>961962</td>\n",
       "      <td>162.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>137</th>\n",
       "      <td>201711</td>\n",
       "      <td>963845</td>\n",
       "      <td>361.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>138</th>\n",
       "      <td>201711</td>\n",
       "      <td>973106</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>139</th>\n",
       "      <td>201711</td>\n",
       "      <td>978089</td>\n",
       "      <td>460.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>140 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     predict_date  class_id  predict_quantity\n",
       "0          201711    103507             607.0\n",
       "1          201711    124140             324.0\n",
       "2          201711    125403             165.0\n",
       "3          201711    136916             215.0\n",
       "4          201711    169673             175.0\n",
       "5          201711    175962             373.0\n",
       "6          201711    178529             213.0\n",
       "7          201711    186250             205.0\n",
       "8          201711    194201             435.0\n",
       "9          201711    194450             339.0\n",
       "10         201711    198427             165.0\n",
       "11         201711    206765            2098.0\n",
       "12         201711    209945             280.0\n",
       "13         201711    219195             354.0\n",
       "14         201711    221795             356.0\n",
       "15         201711    245609             162.0\n",
       "16         201711    248352             651.0\n",
       "17         201711    249875              85.0\n",
       "18         201711    250658             178.0\n",
       "19         201711    265980             280.0\n",
       "20         201711    270690             988.0\n",
       "21         201711    281301             537.0\n",
       "22         201711    281792             524.0\n",
       "23         201711    289386             468.0\n",
       "24         201711    289403             274.0\n",
       "25         201711    290854             251.0\n",
       "26         201711    291086             600.0\n",
       "27         201711    291514              63.0\n",
       "28         201711    302513             117.0\n",
       "29         201711    304458             463.0\n",
       "..            ...       ...               ...\n",
       "110        201711    745137            1225.0\n",
       "111        201711    750340             191.0\n",
       "112        201711    760412              76.0\n",
       "113        201711    786351             438.0\n",
       "114        201711    789290              89.0\n",
       "115        201711    810398             120.0\n",
       "116        201711    815230             193.0\n",
       "117        201711    819061             377.0\n",
       "118        201711    842246             139.0\n",
       "119        201711    851857             249.0\n",
       "120        201711    854079             261.0\n",
       "121        201711    854548             140.0\n",
       "122        201711    861459             290.0\n",
       "123        201711    871642             182.0\n",
       "124        201711    872180             146.0\n",
       "125        201711    883691             338.0\n",
       "126        201711    890189            1497.0\n",
       "127        201711    905061             417.0\n",
       "128        201711    905745             204.0\n",
       "129        201711    914348             866.0\n",
       "130        201711    923841             597.0\n",
       "131        201711    924154            1418.0\n",
       "132        201711    948936              78.0\n",
       "133        201711    950264            1156.0\n",
       "134        201711    953842            1416.0\n",
       "135        201711    961362             108.0\n",
       "136        201711    961962             162.0\n",
       "137        201711    963845             361.0\n",
       "138        201711    973106              68.0\n",
       "139        201711    978089             460.0\n",
       "\n",
       "[140 rows x 3 columns]"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res_1611_1710"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [],
   "source": [
    "res_1611_1710.to_csv(\"../../result/1611_mul_1.15+1710_mul_1.15.csv\",index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "tt = res[['class_id','predict_quantity']].combine_first(s1611)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "559132.0    2\n",
       "175962.0    2\n",
       "948936.0    2\n",
       "194450.0    2\n",
       "628041.0    2\n",
       "249875.0    2\n",
       "136916.0    2\n",
       "961362.0    2\n",
       "651347.0    2\n",
       "732758.0    2\n",
       "961962.0    2\n",
       "736094.0    2\n",
       "516750.0    2\n",
       "302513.0    2\n",
       "350259.0    2\n",
       "198427.0    2\n",
       "360648.0    2\n",
       "540712.0    2\n",
       "379265.0    2\n",
       "291514.0    2\n",
       "819061.0    2\n",
       "580470.0    2\n",
       "501564.0    2\n",
       "378536.0    2\n",
       "649213.0    2\n",
       "482497.0    2\n",
       "178529.0    2\n",
       "250658.0    2\n",
       "560265.0    2\n",
       "221795.0    2\n",
       "           ..\n",
       "591790.0    2\n",
       "304458.0    2\n",
       "786351.0    2\n",
       "425432.0    2\n",
       "714152.0    2\n",
       "417803.0    1\n",
       "653436.0    1\n",
       "890189.0    1\n",
       "854548.0    1\n",
       "861459.0    1\n",
       "340175.0    1\n",
       "872180.0    1\n",
       "103507.0    1\n",
       "527765.0    1\n",
       "815230.0    1\n",
       "687270.0    1\n",
       "359378.0    1\n",
       "842246.0    1\n",
       "169673.0    1\n",
       "714150.0    1\n",
       "725137.0    1\n",
       "125403.0    1\n",
       "905061.0    1\n",
       "194201.0    1\n",
       "612523.0    1\n",
       "789290.0    1\n",
       "124140.0    1\n",
       "760412.0    1\n",
       "437063.0    1\n",
       "376193.0    1\n",
       "Name: class_id, Length: 140, dtype: int64"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tt['class_id'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "res['predict_quantity'] = pred_Nov\n",
    "res.to_csv(\"../../result/v0.5.csv\",index=False)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
